package Java.BlackHorse.a02StreamTest;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

public class Test1 {
    public static void main(String[] args) {
      /*  int[] arr = {1,2,3,4,5,6,7,8,9,10};
        Arrays.stream(arr).filter(i -> i%2==0).forEach(i -> System.out.println(i));*/
        ArrayList<Integer> lsit = new ArrayList<>();
        Collections.addAll(lsit,1,2,3,4,5,6,7,8,9,10);
        List<Integer> newlist=lsit.stream().filter(n -> n % 2==0).collect(Collectors.toList());

        System.out.println(newlist);
    }
}
